﻿@model blacksoft.Models.ProgramacionViaje
@using blacksoft.Helpers

@{
    ViewBag.Title = "Viajes";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<div class="block big">
    <div class="titlebar">
        <h3>Nuevo Viaje</h3>
    </div>
    <div class="block_cont">
        @using (Html.BeginForm())
        {
            @Html.AntiForgeryToken()
            <div class="form">
                @*<div class="form-group">
                        @Html.LabelFor(model => model.FechaHasta, new { @class = "control-label col-md-2" })
                        <div class="col-md-10">
                            @Html.TextBoxFor(model => model.FechaHasta, new { @type = "date" })
                            <a style="color:red; ">@Html.ValidationMessageFor(model => model.FechaHasta)</a>
                        </div>
                    </div>*@

                <div class="form-row">
                    <table>
                        <tr>
                            <td>
                                @Html.LabelForRequired(model => model.FechaSalida)
                                @Html.EditorFor(model => model.FechaSalida)
                                @Html.ValidationMessageFor(model => model.FechaSalida)                               
                            </td>
                            <td>
                                @Html.LabelForRequired(model => model.FechaLlegada)
                                @Html.EditorFor(model => model.FechaLlegada)
                                @Html.ValidationMessageFor(model => model.FechaLlegada)
                                @Html.ValidationMessage("ErrorFechaSalida")
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="form-row">
                    @Html.LabelForRequired(model => model.Descripcion)
                    @Html.EditorFor(model => model.Descripcion)
                    @Html.ValidationMessageFor(model => model.Descripcion)

                </div>

                <div class="form-row">
                    @Html.LabelFor(model => model.CapacidadPasajeros)
                    @Html.TextBoxFor(model => model.CapacidadPasajeros, new { @class = "text-box single-line", @disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.CapacidadPasajeros)

                    @Html.HiddenFor(model => model.CapacidadPasajeros)
                </div>

                <div class="form-row">
                    @Html.LabelForRequired(model => model.TipoServicio)
                    @Html.DropDownList("TipoServicio", new[]
                        {
                            new SelectListItem() {Text = "Económico", Value="1"},
                            new SelectListItem() {Text = "VIP", Value="2"},
                        }, "Seleccione")
                    @Html.ValidationMessageFor(model => model.TipoServicio)
                </div>

                <div class="form-row">
                    @Html.LabelForRequired(model => model.Precio)
                    @Html.EditorFor(model => model.Precio)
                    @Html.ValidationMessageFor(model => model.Precio)
                </div>

                <div class="form-row">
                    @Html.LabelFor(model => model.Estado)
                    @Html.DropDownList("Estado", new[]
                        {
                            new SelectListItem() {Text = "Programado", Value="PR"},
                        }, string.Empty, new { @disabled = "disabled" })
                    @Html.ValidationMessageFor(model => model.Estado)

                    @Html.HiddenFor(model => model.Estado)
                </div>

                <div style="padding-top:20px">
                    <div class="titlebar">
                        <a style="display:inline-block"><h3>Seleccionar Choferes</h3>@Html.ValidationMessage("ErrorMinChoferes")</a>
                    </div>
                    

                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoPaterno", "Apellido Paterno", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoMaterno", "Apellido Materno", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Nombre", "Nombre", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("DNI", "DNI", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("CargoPersonal", "Cargo", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            @*<td>
                                @Html.TextBox("Telefono", "Telefono", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>*@
                            @*<td>
                                    @Html.TextBox("Celular", "Celular", new { @style = "width:100px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                                </td>*@
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Choferes)
                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <a style="display:inline-block"><h3>Seleccionar Terramozas</h3>@Html.ValidationMessage("ErrorMinTerramozos")</a>
</div>
                    

                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoPaterno", "Apellido Paterno", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("ApellidoMaterno", "Apellido Materno", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Nombre", "Nombre", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("DNI", "DNI", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("CargoPersonal", "Cargo", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            @*<td>
                                @Html.TextBox("Telefono", "Telefono", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>*@
                            @*<td>
                                    @Html.TextBox("Celular", "Celular", new { @style = "width:100px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                                </td>*@
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Terramozas)

                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <a style="display:inline-block"> <h3>Seleccionar Unidad de Transporte</h3>@Html.ValidationMessage("ErrorMinBuses")</a>
</div>
                    

                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Placa", "Placa", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Año", "Año", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Tipo", "Tipo", new { @style = "width:150px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Ruta", "Ruta", new { @style = "width:250px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Buses)

                </div>
                <div style="padding-top:50px">
                    <div class="titlebar">
                        <h3>Seleccionar Promociones a Aplicar</h3>
                    </div>
                    <table style="background: #363D47">
                        <tr>
                            <td>
                                @Html.TextBox("SELECCIONAR", "SELECCIONAR", new { @style = "width:100px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Descripcion", "Descripcion", new { @style = "width:150px; color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Porcentaje", "Porcentaje de Descuento", new { @style = "width:150px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Puntos", "Puntos Requeridos", new { @style = "width:130px;color: white;:#363D47;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Inicio", "Fecha de Inicio", new { @style = "width:130px;color: white;background:#363D47; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Fin", "Fecha de Fin", new { @style = "width:130px;background:#363D47; color: white;border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Estado", "Estado", new { @style = "width:70px;background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                            <td>
                                @Html.TextBox("Cliente", "Tipo de Cliente", new { @style = "width:130px; background:#363D47;color: white; border: 0px solid #000000", @disabled = "disabled" })
                            </td>
                        </tr>
                    </table>
                    @Html.EditorFor(model => model.Promociones)
                </div>

                <br />
                <div class="form-row">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="Registrar" class="btn btn-default" />
                        <br />
                        @Html.ActionLink("Regresar al listado", "Index")
                    </div>
                </div>
            </div>
        }

    </div>
</div>

@*<script>
        function startLoop() {
            //if (myInterval > 0) clearInterval(myInterval);  // stop
            myInterval = setInterval("doSomething()", 1);  // run
        }
        function doSomething() {
            $(".rbBus").change(function () {
                    $namerb = $(".rbBus").attr("name");
                    if ($(".rbBus").is(":checked")) {
                        $(".rbBus").each(function () {
                            $namerb_otros = $(this).attr("name");
                            if ($namerb_otros != $namerb) {
                                $(this).prop('checked', false);
                            }
                        })
                    }
                })};
    </script>*@
